package LeetCode;

import java.util.Arrays;

public class Problem1 {
    public static void main(String[] args) {
        int[] nums = {3};
        int i = removeElement(nums,3);
        System.out.println(i);
        System.out.println(Arrays.toString( nums));

    }


    public static int removeElement(int[] nums, int val) {
        int n = nums.length;
        int left = 0;
        for (int i = 0; i < n; i++) {
            if (nums[i] != val) {
                nums[left] = nums[i];
                left++;
            }
        }
        return left;
    }
}
